package com.xie.pojo;

import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;

@Table(name = "zy")
@Data
public class BaiduWap implements Serializable {
    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer id;
    private String name;
    private String www;
    private String password;
    private Integer count;
    private Integer status;
    private String upload;
    private Integer type;

    @Transient
    private String statusStr;
    @Transient
    private String typeStr;

    public String getStatusStr() {
        return status==1?"有效":"无效";
    }

    public String getTypeStr() {
        switch (type){
            case 1:
                typeStr="视频资源";
                break;
            case 2:
                typeStr="图书资源";
                break;
            default:
                typeStr="其他资源";
                break;

        }

        return typeStr;
    }
}
